﻿/********************************************************************
	created:	2011/05/29
	created:	29:5:2011   21:25
	filename: 	D:\My Documents\Visual Studio 2010\Projects\IntranetMessagerClient\Client\ThisUser.cs
	file path:	D:\My Documents\Visual Studio 2010\Projects\IntranetMessagerClient\Client
	file base:	ThisUser
	file ext:	cs
	author:		
	
	purpose:	客户端的用户信息类
*********************************************************************/
using System.ComponentModel;
using CommonLibrary;

namespace Client
{
    internal class ThisUser : INotifyPropertyChanged
    {
        private int _myUid;

        public ThisUser()
        {
            _myUid = -1;
            _isLogin = false;
        }

        public int MyUid
        {
            get { return _myUid; }
            set
            {
                _myUid = value;
                OnPropertyChanged("MyUid");
            }
        }

        private string _myName;
        public string MyName
        {
            get { return _myName; }
            set
            {
                _myName = value;
                OnPropertyChanged("MyName");
            }
        }

        private bool _isLogin;
        public bool IsLogin
        {
            get { return _isLogin; }
            set
            {
                _isLogin = value;
                OnPropertyChanged("IsLogin");
            }
        }

        private UserInfoClass[] _usersInfos;
        public UserInfoClass[] UsersInfos
        {
            get { return _usersInfos; }
            set
            {
                _usersInfos = value;
                OnPropertyChanged("UsersInfos");
            }
        }

        private bool _getUsersInfo;
        public bool GetUsersInfo
        {
            get { return _getUsersInfo; }
            set
            {
                _getUsersInfo = value;
                OnPropertyChanged("GetUsersInfo");
            }
        }

        private bool _isUpdateKey;
        public bool IsUpdateKey
        {
            get { return _isUpdateKey; }
            set
            {
                _isUpdateKey = value;
                OnPropertyChanged("IsUpdateKey");
            }
        }

        private bool _beginUpdateKey;
        public bool BeginUpdateKey
        {
            get { return _beginUpdateKey; }
            set
            {
                _beginUpdateKey = value;
                OnPropertyChanged("BeginUpdateKey");
            }
        }

        //public string PasswordHashInBase64String { get; set; }
        public string DesKey { get; set; }
        public string DesIv { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string propValue)
        {
            var handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propValue));
        }

    }
}
